import request from '@/utils/request'

// 列表
export function getList (params) {
  return request({
    url:'/data',
    method: 'GET',
    params
  })
}
// 新增
export function addList(data) {
  return request({
    url:'/data',
    method:'POST',
    data
  })
}
// 删除
export function removeList(id) {
  return request ({
    url: `/data/${id}`,
    method: 'DELETE'
  })
}
// 编辑
export function changeList(data){
  return request ({
    url :`/data/${data.id}`,
    method:'PUT',
    id
  })
}

//详情
export function detailsList(id) {
  return request({
    url: `/data/${id}`,
    method: 'get'
  })
}

//搜索
export function searchList(value) {
  return request({
    url: `/data/?name=${value}`,
    method: 'get'
  })
}